home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / cupsys.preinst < prev    next >
Encoding:
Text File  |  2007-04-04  |  2.3 KB  |  85 lines

  1. #! /bin/sh
  2. # preinst script for cupsys
  3. #
  4. # see: dh_installdeb(1)
  5.  
  6. set -e
  7.  
  8. # summary of how this script can be called:
  9. #        * <new-preinst> `install'
  10. #        * <new-preinst> `install' <old-version>
  11. #        * <new-preinst> `upgrade' <old-version>
  12. #        * <old-preinst> `abort-upgrade' <new-version>
  13.  
  14. case "$1" in
  15.     install)
  16.     ;;
  17.  
  18.     upgrade)
  19.     if dpkg --compare-versions "$2" le 1.1.23-6; then
  20.       [ -f /etc/cups/printers.conf ] && mv /etc/cups/printers.conf /etc/cups/printers.conf.save
  21.       [ -f /etc/cups/classes.conf ] && mv /etc/cups/classes.conf /etc/cups/classes.conf.save
  22.     fi
  23.     if [ -e /var/lib/cups/conf -a ! -L /var/lib/cups/conf -a ! -e /etc/cups ]; then
  24.         echo -n "Moving configuration files..."
  25.         mkdir -p /etc/cups || true
  26.         if [ `ls /var/lib/cups/conf | wc -l` -ne "     0" ]; then
  27.         cp -a /var/lib/cups/conf/* /etc/cups
  28.         fi
  29.         rm -rf /var/lib/cups/conf
  30.         echo "done."
  31.     fi
  32.  
  33.     if [ -e /var/lib/cups/ppd -a ! -L /var/lib/cups/ppd -a ! -e /etc/cups/ppd ]; then
  34.         echo -n "Moving printer definition files..."
  35.         mkdir -p /etc/cups/ppd || true
  36.         if [ `ls /var/lib/cups/ppd | wc -l` -ne "     0" ]; then
  37.         cp -a /var/lib/cups/ppd/* /etc/cups/ppd
  38.         fi
  39.         rm -rf /var/lib/cups/ppd
  40.         echo "done."
  41.     fi
  42.  
  43.     if [ -e /var/lib/cups/logs -a ! -L /var/lib/cups/logs ]; then
  44.         rmdir /var/lib/cups/logs || true
  45.     fi
  46.  
  47.     # Remove dangling pdftops.conf symlink, which is obsolete anyway
  48.     if [ -L /etc/cups/pdftops.conf -a ! -e /etc/cups/pdftops.conf ]; then
  49.         rm -f /etc/cups/pdftops.conf
  50.     fi
  51.  
  52.     # Remove obsolete /etc/cups/certs
  53.     [ -L /etc/cups/certs ] && rm -f /etc/cups/certs || true
  54.  
  55.     # Fix global SSL certificate owner/mode breakage
  56.     if dpkg --compare-versions "$2" lt-nl '1.2.1-2ubuntu2'; then
  57.         if [ -e /etc/ssl/certs/ssl-cert-snakeoil.pem ]; then
  58.         chown root:root /etc/ssl/certs/ssl-cert-snakeoil.pem
  59.         chmod 0644 /etc/ssl/certs/ssl-cert-snakeoil.pem
  60.         fi
  61.         if [ -e /etc/ssl/private/ssl-cert-snakeoil.key ]; then
  62.         chown root:ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key
  63.         chmod 0640 /etc/ssl/private/ssl-cert-snakeoil.key
  64.         fi
  65.     fi
  66.     ;;
  67.  
  68.     abort-upgrade)
  69.     ;;
  70.  
  71.     *)
  72.         echo "preinst called with unknown argument \`$1'" >&2
  73.         exit 0
  74.     ;;
  75. esac
  76.  
  77. # dh_installdeb will replace this with shell code automatically
  78. # generated by other debhelper scripts.
  79.  
  80.  
  81.  
  82. exit 0
  83.  
  84.  
  85.